<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.min.js"></script>
</head>
<body>
<div id="app">
    <input type="text" v-model="username"> <br>
    我是父组件中的数据:{{username}} <br>
    <app :test="username"></app>
</div>

<script>
    let app = {
        template: `
        <div>
        我是子组件中的数据:{{test}}
        </div>
        `,
        props: ['test']
    }

    new Vue({
        el: '#app',
        data: {
            username: '',
        },
        components: {
            app: app
        }
    })
</script>
</body>
</html>